<?php
require_once("Tpl/header.html");
?>
        <div id="main">
            <div class="header">
                <h1>UserManage</h1>
            </div>
            <div class="content">
                <div class="table-responsive">
                    <table class="pure-table pure-table-horizontal">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>UserId</th>
                                <th>Identity</th>
                                <th>UserName</th>
                                <th>Email</th>
                                <th>Subjects</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
                                foreach ($UserList as $key => $user) {
                                    echo "<tr>".
                                         "<td>".($key+1)."</td>".
                                         "<td>".$user["UserId"]."</td>".
                                         "<td>";
                                    if ($user["UserLevel"] == 2) {
                                        echo "教师";
                                    }
                                    else if ($user["UserLevel"] == 1) {
                                        echo "学生";
                                    }
                                    echo "</td>".
                                         "<td>".$user["UserName"]."</td>".
                                         "<td>".$user["Email"]."</td>".
                                         "<td>".$user["count(SubId)"]."</td>".
                                         "<td><a href=\"/index.php/Member/del?uid=".$user["UserId"]."\">delete</a></td>".
                                         "</tr>";
                                }
                            ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
